package com.woniuxy.api;

import com.woniu.cloud.common.dto.Result;

import com.woniuxy.cloud.form.AddGoodCarForm;
import com.woniuxy.cloud.form.AddServiceCarForm;
import com.woniuxy.form.GetOrder;
import org.springframework.cloud.openfeign.FeignClient;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import org.springframework.web.bind.annotation.*;


import org.springframework.web.bind.annotation.*;



import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * @description: 服务api
 * @author: ZXG
 * @time: 2021/9/23
 */
@FeignClient(value = "user-assembly",contextId = "serviceApi")
public interface ServiceApi {


    /**
     * 根据服务订单id查看服务进度
     * @param serviceOrderDetailId 服务订单id
     * @return Result
     **/
    @GetMapping("/getUserServiceProcessListByUserId")
    Result getUserServiceProcessListByUserId(@RequestParam("serviceOrderDetailId")Integer serviceOrderDetailId);



    /**
     * 开始服务 修改服务详情订单状态
     * @param serviceOrderDetailId 服务订单id
     * @return Result
     **/
    @PutMapping("/updateServiceOrderDetail")
    Result updateServiceOrderDetail(@RequestParam("serviceOrderDetailId")Integer serviceOrderDetailId);

    /**
     * 根据用户id获取个人信息
     * @return Result
     **/
    @GetMapping("/getPersonalInformation")
    Result getPersonalInformation();


    /**
    * 查询一级服务
    * @return Result
    *
     * 查询一级服务
     * @return Result
     **/
    @GetMapping("/getFirstService")
    Result getFirstService(@RequestParam("pageIndex")Integer pageIndex,@RequestParam("pageSize")Integer pageSize);


    /**
     * 根据一级服务id查询二级服务及相关店铺
     * @param firstServiceId 一级服务id
     * @return
     */
    @GetMapping("/getSecondService")
    Result getSecondService(@RequestParam("firstServiceId")Integer firstServiceId);



    /**
     * 根据用户id获取商品购物车列表
     * @return Result
     **/
    @GetMapping("/getGoodCarByUserId")
    Result getGoodCarByUserId();


    /**
     * 根据用户id获取服务购物车列表
     * @return Result
     **/
    @GetMapping("/getServiceCarByUserId")
    Result getServiceCarByUserId();


    /**
    * 根据用户id获取商品订单列表
    * @return Result
     * @return Result
     **/
    @GetMapping("/getGoodOrderByUserId")
    Result getGoodOrderByUserId(@RequestParam("当前页")Integer pageIndex);


    /**
     * 根据用户id获取服务订单列表
     * @param getOrder
     * @return Result
     **/
    @GetMapping("/getServiceOrderByUserId")
    Result getServiceOrderByUserId(@RequestBody GetOrder getOrder);




    /**
    * 搜索商品
    * @return Result
    *
     * @return Result
     */
    @GetMapping("/getScoreOrderByUserId")
    Result getScoreOrderByUserId(@RequestBody GetOrder getOrder);


    /**
     * 查询商品
     * @param goodName 商品名称
     * @param goodType 商品类别
     * @param pageIndex 当前页
     * @return
     */
    @GetMapping("/getGoodsList")
    Result getGoodsList(@RequestParam("goodName") String goodName,@RequestParam("goodType") String goodType,@RequestParam("pageIndex")Integer pageIndex);




    /**
     * 根据店铺id查询店铺
     * @param storeId 店铺id
     * @return Result
     **/
    @GetMapping("/getStoreByStoreId")
    Result getStoreByStoreId(@RequestParam("storeId")Integer storeId);

    /***
     * 查询附近店铺
     * @return Result
     **/
     @GetMapping("/getNearbyShops")
     Result getNearbyShops(@RequestParam("storeLongitude")Double storeLongitude,
                           @RequestParam("storeLatitude")Double storeLatitude,
                           @RequestParam("radius") Double radius);




    /**
     * 确认收货修改商品订单状态
     * @param goodOrderId 商品订单id
     * @return Result
     **/
    @PutMapping("/updateGoodOrder")
    Result updateGoodOrder(Integer goodOrderId);

    /**
     * 新增商品购物车
     * @param addGoodCarForm
     * @return
     */
    @PostMapping("/insertGoodCar")
    Result insertGoodCar(@RequestBody AddGoodCarForm addGoodCarForm) throws NoSuchFieldException;


    /**
     * 新增服务购物车
     * @param addServiceCarForm
     * @return
     */
    @PostMapping("/insertServiceCar")
    Result insertServiceCar(@RequestBody AddServiceCarForm addServiceCarForm);
}